<xsl:stylesheet version="2.0" xmlns:foo="http://something" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="/apps/engine/utils/translate_fct.xsl"/>
	<xsl:variable name="dict" select="doc('input:translation')/translation"/>
	<xsl:template match="/">
		<content>
			<h1>
				<xsl:value-of select="foo:translate('Users Management', $dict)"/>
			</h1>
			<form id="add_user" class="add_form" method="get" action="../addUser/">
				<fieldset>
					<legend>
						<xsl:value-of select="foo:translate('Create a new user', $dict)"/>
					</legend>
					<p class="submit">
						<input class="button" id="create_user" type="submit" value="{foo:translate('Create', $dict)}"/>
					</p>
				</fieldset>
			</form>
			<h2><xsl:value-of select="foo:translate('Portal users', $dict)"/></h2>
			<xsl:apply-templates select="/list/user"/>
		</content>
	</xsl:template>
	<xsl:template match="user">
		<div>
			<xsl:attribute name="class">item <xsl:if test="(position() mod 2)= 0">even</xsl:if>
				<xsl:if test="(position() mod 2)!= 0">odd</xsl:if>
			</xsl:attribute>
			<div class="name">
				<xsl:value-of select="username"/>
			</div>
			<div class="control">
				<a href="../editUser/?userId={username}" class="editOption control" title="{foo:translate(concat('Modifiy user ''',username,''''), $dict)}"><img src="../../views/img/admin-users-edit.png" alt="{foo:translate(concat('Modifiy user ''',username,''''), $dict)}" class="controlImage"/></a>
			<a href="#" id="d_{username}" class="deleteOption control" title="{foo:translate(concat('Delete user ''',username,''''), $dict)}"><img src="../../views/img/admin-users-delete.png" alt="{foo:translate(concat('Delete user ''',username,''''), $dict)}" class="controlImage"/></a>
			</div>
		</div>
		<div id="deleteContainer_{username}" class="delete container" style="display: none;">
			<form class="form_container" action="../action/deleteUser" method="post">
				<div class="form_line">
					<xsl:value-of select="foo:translate(concat('Are you sure you want to delete the ''',username,''' user ?'), $dict)"/>
				</div>
				<input name="userId" type="hidden" value="{username}"/>
				<input class="button" type="submit" value="{foo:translate('Delete', $dict)}"/>
				<input class="button" type="reset" value="{foo:translate('Cancel', $dict)}"/>
			</form>
		</div>
	</xsl:template>

</xsl:stylesheet>